import { getAction, deleteAction, putAction, postAction, httpAction } from '@/api/manage'



//角色管理
const addRole = (params)=>postAction("/role/add",params);
const editRole = (params)=>putAction("/role/update",params);
const checkRole = (params)=>getAction("/role/checkIsNameExist",params);
const roleAllList = (params)=>getAction("/role/allList",params);
//用户管理
const registerUser = (params)=>postAction("/user/registerUser",params);
const addUser = (params)=>postAction("/user/addUser",params);
const editUser = (params)=>putAction("/user/updateUser",params);
const getUserList = (params)=>getAction("/user/getUserList",params);
const queryPermissionsByUser = (params)=>postAction("/function/findMenuByPNumber",params);

//仓储管理表
const addStorage = (params)=>postAction("/storage/add",params);
const editStorage = (params)=>putAction("/storage/update",params);
const addWareHouse = (params)=>postAction("/wareHouse/add",params);
const editWareHouse = (params)=>putAction("/wareHouse/update",params);
const getWareHouseList = (params)=>postAction("/wareHouse/getWareHouseList",params);
const checkWareHouse = (params)=>getAction("/wareHouse/checkIsNameExist",params);

//发票管理表
const addReceipt = (params)=>postAction("/receipt/add",params);
const editReceipt = (params)=>putAction("/receipt/update",params);

//产品发货表
const addDelivery = (params)=>postAction("/delivery/add",params);
const editDelivery = (params)=>putAction("/delivery/update",params);


//工程管理
const addEngineer = (params)=>postAction("/engineer/add",params);
const editEngineer = (params)=>putAction("/engineer/update",params);
const getEngineerList = (params)=>getAction("/engineer/getEngineerList",params);
const checkEngineer = (params)=>getAction("/engineer/checkIsNameExist",params);
const getEngineerInfo = (params)=>getAction("/engineer/getEngineerInfo",params);

// 业务配置管理
const addBusinessConfigOpeListManage = (params)=>postAction("/configOperator/add",params);
const editBusinessConfigOpeListManage = (params)=>putAction("/configOperator/update",params);
const addBusinessConfigChannelListManage = (params)=>postAction("/configSource/add",params);
const editBusinessConfigChannelListManage = (params)=>putAction("/configSource/update",params);

// 客户管理
// const addCustom = (params)=>postAction("/custom/add",params);
const addCustom = (params)=>postAction("/custom/addCustomAndItem",params);
// const editCustom = (params)=>putAction("/custom/update",params);
const editCustom = (params)=>putAction("/custom/updateCustomAndItem",params);

  // 客户管理的详情页
const getCustomOne = (params)=>getAction("custom/getCustomInfoById",params);
const getCustomInfoByNum = (params)=> getAction("/custom/getCustomInfoByNum",params)



// 业务管理
const addConfigBusiness = (params)=>postAction("configBusiness/add",params);
const getConfigBusinessList = (params)=>getAction("/configBusiness/getAllList",params);
const getConfigOperatorList = (params)=>getAction("/configOperator/getAllList",params);
const getConfigSourceList = (params)=>getAction("/configSource/getAllList",params);
const editBusinessAndItem = (params)=>putAction("/business/updateBusinessAndItem",params);
// /business/addBusPro
const addBusPro = (params)=>postAction("/business/addBusPro",params);
const freezeBusPro = (params)=>postAction("/business/freezeBusPro",params);



//产品下单
const addEngineerProduce = (params)=>postAction("/engineerProduce/add",params);
const editEngineerProduce = (params)=>putAction("/engineerProduce/update",params);
const getDeliveryByProduceName = (params)=>getAction("/engineerProduce/getDeliveryByProduceName",params);
const checkEngineerProduce = (params)=>getAction("/engineerProduce/checkIsNamesExist",params);
const getEngineerProduceList = (params)=>getAction("/engineerProduce/getEngineerProduceList",params);

//工程补充
const addEngineerSupply = (params)=>postAction("/engineerComplement/add",params);
const editEngineerSupply = (params)=>putAction("/engineerComplement/update",params);

//功能管理
const addFunction = (params)=>postAction("/function/add",params);
const editFunction = (params)=>putAction("/function/update",params);
const checkFunction = (params)=>getAction("/function/checkIsNameExist",params);

 const fileSizeLimit = (params)=>getAction("/systemConfig/fileSizeLimit",params);
//平台参数
const getPlatformConfigByKey = (params)=>getAction("/platformConfig/getPlatformConfigByKey",params);
//用户|角色|模块关系
const addUserBusiness = (params)=>postAction("/userBusiness/add",params);
const editUserBusiness = (params)=>putAction("/userBusiness/update",params);
const checkUserBusiness = (params)=>getAction("/userBusiness/checkIsValueExist",params);
const updateBtnStrByRoleId = (params)=>postAction("/userBusiness/updateBtnStr",params);


// 财务管理
// /expenditure/getAllList
const getExpenditureList = (params)=>getAction("/expenditure/getAllList",params);
// 财务支出详情
const getExpenditureInfoById = (params)=>getAction("/expenditure/getExpenditureInfo",params);

// 财务收入详情
const getIncomeInfoById = (params)=>getAction("/income/getIncomeInfo",params);

// 资产列表详情
const getPropertyInfoById = (params)=>getAction("/property/getPropertyInfo",params);


// 收支管理添加
const addProperty = (params)=>postAction("/property/add",params);
// 
const addExpenditure = (params)=>postAction("/expenditure/add",params);

const addIncome = (params)=>postAction("/income/add",params);

// 收支管理修改
// /expenditure/update
const editExpenditure = (params)=>putAction("/expenditure/update",params);
const editIncome = (params)=>putAction("/income/update",params);
const editProperty = (params)=>putAction("/property/update",params);


// 收支配置
// /incomeItem/getAllList
const getAllListIncome = (params)=>getAction("/incomeItem/getAllList",params);
const getIncomeItemList = (params)=>getAction("/incomeItem/list",params);
const getIncomeItemInfo = (params)=>getAction("/incomeItem/getIncomeItemInfo",params);
const addIncomeItem = (params)=>postAction("/incomeItem/add",params);
const editIncomeItem = (params)=>putAction("/incomeItem/update",params);



// 存储柜配置
// organization/getOrganizationTree
const getOrganizationTree = (params)=>getAction("/organization/getOrganizationTree",params);
// organization/add
const addOrganization = (params)=>postAction("/organization/add",params);
// /organization/checkIsNameExist
const checkOrganization = (params)=>getAction("/organization/checkIsNameExist",params);

// /organization/findById
const getOrganizationById = (params)=>getAction("/organization/findById",params);

// /incomeItem/getFinancialState
const getFinancialState = (params)=>getAction("/incomeItem/getFinancialState",params);

// business/getBusinessStatistics
const getBusinessStatistics = (params)=>getAction("/business/getBusinessStatistics",params);


// 商家
const getTenantInfoById = (params)=>getAction("/tenant/getTenantInfo",params);
const addTenant = (params)=>postAction("/tenant/add",params);
const editTenant = (params)=>putAction("/tenant/update",params);


// /business/list?typeR="回收"&statusR="存续中,已逾期,即将到期"&currentPage=1&pageSize=10000   
const getBusinessListData = (params)=>getAction('business/getValueList');

// /business/list
const getBusinessList = (params)=>getAction("/business/list",params);


export {
  getBusinessListData,

  getBusinessList,

  getTenantInfoById,
  addTenant,
  editTenant,

  getFinancialState,
  getBusinessStatistics,
  editProperty,
  editIncome,
  editExpenditure,

  getIncomeInfoById,
  getPropertyInfoById,
  getIncomeItemInfo,

  addOrganization,
  getOrganizationTree,
  checkOrganization,
  getOrganizationById,

  getIncomeItemList,
  addIncomeItem,
  editIncomeItem,
  getAllListIncome,

  addProperty,
  addIncome,
  addExpenditure,
  getExpenditureInfoById,
  getExpenditureList,

  addBusPro,
  freezeBusPro,
  addStorage,
  addWareHouse,
  editWareHouse,
  editStorage,
  addDelivery,
  editDelivery,
  addReceipt,
  editReceipt,
  addEngineer,
  editEngineer,
  getEngineerList,
  getEngineerInfo,
  getDeliveryByProduceName,
  getWareHouseList,
  addEngineerProduce,
  editEngineerProduce,
  getEngineerProduceList,
  addEngineerSupply,
  editEngineerSupply,
  addRole,
  editRole,
  checkRole,
  roleAllList,
  registerUser,
  addUser,
  editUser,
  getUserList,
  queryPermissionsByUser,
  addFunction,
  editFunction,
  checkFunction,
  checkEngineer,
  checkEngineerProduce,
  checkWareHouse,
  fileSizeLimit,
  getPlatformConfigByKey,
  addUserBusiness,
  editUserBusiness,
  checkUserBusiness,
  updateBtnStrByRoleId,
  addBusinessConfigOpeListManage,
  editBusinessConfigOpeListManage,
  addBusinessConfigChannelListManage,
  editBusinessConfigChannelListManage,
  addCustom,
  editCustom,
  getCustomOne,
  addConfigBusiness,
  getConfigBusinessList,
  getConfigSourceList,
  getConfigOperatorList,
  editBusinessAndItem,
  getCustomInfoByNum
}



